package com.itheima.properties;

import java.util.Map;
import java.util.Properties;
import java.util.Set;

/*
Properties 作为map的基本使用
 */
public class Demo01 {

    public static void main(String[] args) {
        Properties prop = new Properties();
       // prop.put(111,222);
        prop.put("宋喆","马蓉");
        prop.put("PGone","小璐");
        /*System.out.println(prop);
        prop.remove("PGone");
        System.out.println(prop);
        prop.put("宋喆","狱友");
        System.out.println(prop);
        System.out.println(prop.get("宋喆"));*/
        Set<Object> keys = prop.keySet();
        for (Object key : keys) {
            System.out.println(key+"="+prop.get(key));
        }
        System.out.println("-----------------");
        Set<Map.Entry<Object, Object>> entries = prop.entrySet();
        for (Map.Entry<Object, Object> entry : entries) {
            System.out.println(entry.getKey()+"%%%"+entry.getValue());
        }
        System.out.println("-----------------");
        prop.forEach((k,v)-> System.out.println(k+"&&&&&&"+v));
    }


}
